package phan.connection;

import java.util.*;
import java.util.Date;
import  phan.connection.MySQLDBConnector;

public class ContactNousBean {

    private String useremail;
    
    private String pseudo;
    private String question;


    public ContactNousBean() {
        useremail = "";
        
        pseudo = "";
        question = "";

        errors = new Hashtable();
    }

    public boolean validate() {
        boolean allOk = true;
        MySQLDBConnector con = new MySQLDBConnector();
            // con.checkUserName(pseudo);

        if (useremail.equals("")) {
            getErrors().put("useremail", "Veuillez entrer votre email !");
            useremail="";
            allOk = false;
        }
        System.out.print("cau hoi la:"+ question);
        if (question.equals("")) {
            getErrors().put("question", "Veuillez entrer votre question !");
            question="";
            allOk = false;
        }
      
       

       
        
        return allOk;
    }
    private Hashtable errors;

    public String getErrorMsg(String s) {
        String errorMsg = (String) getErrors().get(s.trim());
        return (errorMsg == null) ? "" : errorMsg;
    }

   
    public Hashtable getErrors() {
        return errors;
    }

    /**
     * @param errors the errors to set
     */
    public void setErrors(Hashtable errors) {
        this.errors = errors;

    }

    /**
     * @return the useremail
     */
    public String getUseremail() {
        return useremail;
    }

    /**
     * @param useremail the useremail to set
     */
    public void setUseremail(String useremail) {
        this.useremail = useremail;
    }

    /**
     * @return the confirmuseremail
     */
   

    /**
     * @return the pseudo
     */
    public String getPseudo() {
        return pseudo;
    }

    /**
     * @param pseudo the pseudo to set
     */
    public void setPseudo(String pseudo) {
        this.pseudo = pseudo;
    }

    /**
     * @return the question
     */
    public String getQuestion() {
        return question;
    }

    /**
     * @param question the question to set
     */
    public void setQuestion(String question) {
        this.question = question;
    }

   
   
}

